<?php

class Appcore_Model_Server_Database
{
 	protected $_con     = null;
    protected $_prefix  = null;
    
    public function __construct(){
    	
    	//temporäre Angabe der Zugangsdaten
    	//DB-Adapter laden
		try{
			$this->_con = Zend_Db::factory('Pdo_Mysql', array(
				    'host'             => 'localhost',
    				'username'         => 'cmsdev',
    				'password'         => 'cmsdev',
    				'dbname'           => 'cmsdev',
		    		'unix_socket'	   => '/var/run/mysqld/mysqld.sock',
		));
				
			//$db = Zend_Db::factory($this->_configSystem->database);
			$this->_con->query("SET NAMES 'utf8'");
		    
		}catch(Exception $e){
		    die('Keine Vebrindung zur Datenbank möglich.');
		}
		
		$profiler = new Zend_Db_Profiler_Firebug('All DB Queries');
		$profiler->setEnabled(true);
		
		// Den Profiler an den DB Adapter anfügen
		$this->_con->setProfiler($profiler); 	
        
        $this->_con->setFetchMode(Zend_Db::FETCH_OBJ);
        $this->_con->query('SET NAMES utf8');
    
        //$config = Sicore_Models_Registry::getConfig(Sicore_Models_Registry::CONFIG_BASE); 
        //$this->_prefix = $config->database->prefix;
        
    }
}
